const infoData = {
    data:[],
    dataChild:[]
}

 const reducer = (state = infoData, action) => {
     let newState = JSON.parse(JSON.stringify(state))
    //  return newState
    switch (action.type) {
        case 'GET_LIST':
            newState.data = action.payload.list
            newState.dataChild = action.payload.list[0].children
            return newState
        default:
            return newState
    }
}

export default reducer